Many communication protocols use packets to convey data and control information through the various devices in a communication network. The data in a packet is typically formatted into fields for control information and payload data. At the implementation level, packets are manipulated as a sequence of binary data. At a higher level of abstraction, packets can be regarded as instances of a structured data type whose components represent static, optional, or alternative fields of the packets. Layers of the communication protocol are based on a packet specification to extract and/or provide necessary information in the packets.
In testing a design for a device that is built for a particular communication protocol, the effort generally involves preparing and inputting packets to the design, capturing packets that are output from the design, and determining whether or not the output packets are correct. The process of generating a suitable set of input packets for testing a design may be time consuming. Not only is it a challenge to prepare a suitable testbench of packets, but the binary representation of packets for low-level testing makes it challenging for a tester to correlate the binary packet data with a high-level representation of what is being tested. In addition, test coverage may be compromised due to the effort involved in constructing and executing tests. The lack of sufficient test coverage may leave parts of a system untested, which may increase the risk of design errors going undetected and being carried through to a production system.
The present invention may address one or more of the above issues.